package com.zd.util;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.SimpleTimeZone;

@Component
public class DateConverter implements Converter<String, Date> {

    @Override
    public Date convert(String s){
        try{
            return new SimpleDateFormat("yyyy-MM-dd").parse(s);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
